<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            box-sizing: border-box;
        }
        
        ul {
            width: 270px;
            margin: 100px auto;
            list-style: none;
        }
        
        li {
            float: left;
            width: 24px;
            height: 24px;
            background: url(../images/sprite.png) no-repeat;
            margin: 15px;
        }
    </style>
</head>

<body>
    <ul>
        <li></li>
        <li></li>
        <li></li>
    </ul>
    <script>
        var lis = document.getElementsByTagName('li')
        for (var i = 0; i < lis.length; i++) {
            lis[i].style.backgroundPosition = '0 -' + i * 44 + 'px'
        }
    </script>
</body>

</html>